package com.jcli._java_swing_入门教程pdf.ch17;

import com.jcli.util.GUIUtil;

import javax.swing.*;

/**
 * @author li
 * @version 1.0
 * @belongsProject novel_20230923
 * @belongsPackage com.jcli._java_swing_入门教程pdf.ch17
 * @className _06_JComboBoxDemo
 * @description TODO  下拉列表框
 * @createTime 2024-01-25  21:00
 */
public class _06_JComboBoxDemo extends JPanel {
    public static _06_JComboBoxDemo instance = new _06_JComboBoxDemo();

    public _06_JComboBoxDemo() {
        //    创建标签
        JLabel label = new JLabel("证件类型");
        //    创建下拉列表
        JComboBox jcb = new JComboBox();
        jcb.setFont(GUIUtil.font);
        //    往下拉列表添加选项
        jcb.addItem("--请选择--");
        jcb.addItem("身份证");
        jcb.addItem("驾驶证");
        jcb.addItem("军官证");
        jcb.addItem("结婚证");
        add(label);
        add(jcb);
    }

    public static void main(String[] args) {
        GUIUtil.showJPanel("下拉框组件案例", instance);
    }
}
